//
//  BookManager.m
//  03-HomeWork
//
//  Created by dllo on 16/7/7.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "BookManager.h"
#import "Book.h"
@implementation BookManager
- (instancetype) initWithBookMAnager {
    self = [super init];
    if (self) {
        self.bookArray = [[NSMutableArray alloc]init];
    }
    return self;
}
- (void)addBook:(Book *)book {
    [self.bookArray addObject:book];
}
- (void)removeBook:(Book *)book {
    [self.bookArray removeObject:book];
}
- (void)modifyBookPrice:(NSString *)book_name book_price:(NSInteger)book_price {
    for (Book *book in self.bookArray) {
        if ([book.book_name isEqualToString:book_name]) {
            book.book_price = book_price;
            NSLog(@"BookName:%@ , BookPrice:%ld", book_name, book_price);
        }
    }
}
- (void)showBook {
    for (Book *book in self.bookArray) {
        NSLog(@"%@",book.book_name);
    }
}

@end
